<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Login view class for Users.
 *
 * @package     Joomla.Site
 * @subpackage  com_users
 * @since       1.5
 */
class UsersViewQuiz extends JViewLegacy
{
	protected $form;

	protected $params;

	protected $state;

	protected $user;

	/**
	 * Method to display the view.
	 *
	 * @param   string  The template file to include
	 * @since   1.5
	 */
	public function display($tpl = null)
	{	
		// Get the view data.
		$this->user		= JFactory::getUser();

		if ($this->user->guest){
			$app = JFactory::getApplication();
			$app->redirect(JURI::base(), '', 302);
		}

		if($this->user->quiz==1){
			$this->setLayout("quiz1");
		}
		
		if($this->user->quiz==2){
			$this->setLayout("quiz2");
		}
		
		if($this->user->quiz==3){
			$this->setLayout("quiz3");
		}
		
		if($this->user->quiz==4){
			$this->setLayout("quiz4");
		}

		parent::display($tpl);
	}
}
